package com.githan.ksback_v2_3.Controller;

import com.alibaba.fastjson.JSON;
import com.githan.ksback_v2_3.Services.QuackResultsHongYangService;
import com.githan.ksback_v2_3.Services.QuackStationHongYangService;
import com.githan.ksback_v2_3.Entity.MineQuakeResultsHongyang;
import com.githan.ksback_v2_3.Entity.MineQuakeStationHongYang;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author https://github.com/Han56
 * @date 2021/3/26 21:26
 */
@RestController
public class HongYangResultsController {

    @Autowired
    QuackResultsHongYangService quackResultsHongYangService;
    @Autowired
    QuackStationHongYangService quackStationHongYangService;

    @GetMapping("/hy_test")
    public String hy_test(){
        List<MineQuakeResultsHongyang> testList= quackResultsHongYangService.getAllHongYangResults();
        String return_json= JSON.toJSONString(testList);
        System.out.println(return_json);
        return return_json;
    }

    @GetMapping("/hy_station")
    public String hy_station(){
        List<MineQuakeStationHongYang> testList = quackStationHongYangService.getAllHongYangStation();
        String return_json =  JSON.toJSONString(testList);
        System.out.println(return_json);
        return return_json;
    }

}
